// Quad3D.h: interface for the CQuad3D class.
#if !defined(AFX_QUAD3D_H__AB4E0616_2035_4818_B7FD_FDACCDEB916F__INCLUDED_)
#define AFX_QUAD3D_H__AB4E0616_2035_4818_B7FD_FDACCDEB916F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
#include "vector.h"

typedef enum postion_t
{
    CENTER,
    LEFTSLIDER,
    RIGHTSLIDER,
    OTHER
};
//////////////////////////////////////////////////////////////////////////
class CQuad3D;
typedef std::vector<CQuad3D*>    ArrayQuad3D;

class CQuad3D
{
public:
    CQuad3D(int Id, float fWidth, float fHeight, CVector& fPosition, float fAngle, GLuint nIdTexture);
    virtual ~CQuad3D();

    void    SetAngle(float fAngle);

    void    SetId(int Id);
    //
    void    SetPosition(CVector& rPosition);
    //偏移
    void    OffsetPos(CVector& rV3Offset);

    int     Click(int x, int y);
    //
    void    Render();

    void    SetCenter(int bCenter);

    void    SetRect();

protected:
    //
    float       m_fWidth, m_fWidthBK;

    float       m_fHeight, m_fHeightBK;

    CVector     m_v3Position;

    float       m_fAngle;

    GLuint      m_nIdTexture;

    int         m_nCenter;

    int         m_nID;

    int         m_nNum;//计数器
    //
#ifndef UNDER_CE
    GLdouble  m_ModelMatrix[16];
    GLdouble  m_ProjMatrix[16];
#endif

#ifdef UNDER_CE
    GLfloat    m_ModelMatrix[16];
    GLfloat    m_ProjMatrix[16];
#endif

    GLint    m_viewport[4];

    bool     m_bIsPlaying;

    int      m_ntop,
             m_nleft,
             m_nright,
             m_nbottom;
    bool     m_bClick;

    int      m_winx, m_winy;

public:
    static int  MakeId();

protected:
    static int  s_nId;

};


//////////////////////////////////////////////////////////////////////////
#endif // !defined(AFX_QUAD3D_H__AB4E0616_2035_4818_B7FD_FDACCDEB916F__INCLUDED_)
